package lab02.test04;

public class Staff {

    String name;
    String num;
    double baseSalary;
    double addSalary;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public double getAddSalary() {


        return addSalary;
    }

    public void setAddSalary() {

        //假设增长额为基础工资的百分之一
        this.addSalary = baseSalary * 0.01;
    }

    public double getBaseSalary() {
        return baseSalary;
    }

    public void setBaseSalary(double baseSalary) {
        this.baseSalary = baseSalary;
    }

    public double sumSalary() {

        return baseSalary + addSalary;
    }


    @Override
    public String toString() {
        return  "员工姓名：" + name +
                "\n员工号码：" + num +
                "\n基本薪水：" + baseSalary +
                "\n增长额：" + addSalary +
                "\n总工资：" + sumSalary();
    }


}
